import html2canvas from 'html2canvas'

export default async function toImage(sourceEle, viewEle) {
  const canvas = await html2canvas(sourceEle)
  viewEle.appendChild(canvas)
  return canvas.toDataURL()
}
